home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Canadian & World Encyclopedia 1998
/
The Canadian & World Encyclopedia 1998 - Disc 2.iso
/
mac
/
prime_CD
/
pb
/
PREVIEW.DIR
/
00124_Script_old slide changer parent
< prev
next >
Wrap
Text File
|
1997-07-22
|
2KB
|
48 lines
on new me
return me
end
on change me, direction
global gSSimageChan, gCreditChan
set slideDescr = ["ea": 13, "in": 5]
set currentSlideName = the name of the member of sprite gSSimageChan
unloadMember member currentSlideName -- minimize RAM usage ?
set temp = currentSlideName
delete char 1 to 2 of temp
-- push delimiter
set oldItemDelim = the itemdelimiter
set the itemdelimiter = "."
delete item 2 of temp
set curSlideNum = integer(temp)
set maxSlideNum = getaprop(slideDescr, char 1 to 2 of currentSlideName)
-- pop delimiter
set the itemdelimiter = oldItemDelim
-- synthesize new member names
set newSlideNum = curSlideNum + direction
if newSlideNum > maxSlideNum then set newSlideNum = 1
if newSlideNum < 1 then set newSlideNum = maxSlideNum
set newSlideMembName = char 1 to 2 of currentSlideName & newSlideNum & ".pct"
set newCredMembName = char 1 to 2 of currentSlideName & newSlideNum & ".cred"
-- guaranteed puppet
puppetsprite gSSimageChan, 1
puppetsprite gCreditChan, 1
-- update slide with transition
set the member of sprite gSSimageChan = the number of member newSlideMembName
if direction > 0 then puppettransition 2
if direction < 0 then puppettransition 1
-- update credit sprite
set the member of sprite gCreditChan to the number of member newCredMembName of castlib "credits"
set the stretch of sprite gCreditChan to false
return me
end